//
//  LevelScreen.m
//  iSudoku
//
//  Created by Tri Vo on 5/22/13.
//  Copyright (c) 2013 Tri Vo. All rights reserved.
//

#import "LevelScreen.h"
#import "GameScreen.h"

@implementation LevelScreen

+ (id)scene {
    CCScene *scene = [CCScene node];
    LevelScreen *levelScene = [LevelScreen node];
    [scene addChild:levelScene];
    return scene;
}


#pragma mark - Screen Methods


- (void)onEnter {
    NSString *keyValue = [[GameUtils getInstance] getValueForKey:@""];
    [m_lblTitle setString:keyValue];
    
    // Easy btn
    keyValue = [[GameUtils getInstance] getValueForKey:@""];
    [m_btnEasy setTitle:keyValue forState:CCControlStateNormal];
    // Normal Btn
    keyValue = [[GameUtils getInstance] getValueForKey:@""];
    [m_btnNormal setTitle:keyValue forState:CCControlStateNormal];
    // Hard Btn
    keyValue = [[GameUtils getInstance] getValueForKey:@""];
    [m_btnHard setTitle:keyValue forState:CCControlStateNormal];
    // Back btn
    keyValue = [[GameUtils getInstance] getValueForKey:@""];
    [m_btnBack setTitle:keyValue forState:CCControlStateNormal];
}

#pragma mark - Screen Events

- (void) btnClicked:(id)sender {
    CCControlButton *btn = (CCControlButton *)sender;
    int tag = btn.tag;
    switch (tag) {
        case EASY:
        {
            [[GameUtils getInstance] setCurrentLevel:GAME_LEVEL_EASY];
        }
            break;
        case NORMAL:
        {
            [[GameUtils getInstance] setCurrentLevel:GAME_LEVEL_NORMAL];
        }
            break;
        case HARD:
        {
            [[GameUtils getInstance] setCurrentLevel:GAME_LEVEL_HARD];
        }
            break;
        default:
            [[GameUtils getInstance] doBack];
            break;
    }
}

- (void) chooseLevel {
//    [[Utils getInstance] setCurrentLevel:chosenLevel];

}



@end
